// ignore_for_file: file_names

import 'package:flutter/material.dart';

class StackComp extends StatelessWidget {
  const StackComp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('堆叠容器'),
        backgroundColor: Colors.pink,
      ),
      body: Center(
        child: Stack(
          // 超出部分处理
          // 1. 不裁剪超出部分
          clipBehavior: Clip.none,
          // 2. 组件对齐方式
          alignment: Alignment.center,
          children: [
            Container(
              width: 200,
              height: 200,
              color: Colors.cyan,
            ),
            // Image组件参照Container四个角定位
            Positioned(top: -105, child: Image.asset('assets/open_eyes.png'))
          ],
        ),
      ),
    );
  }
}
